﻿using System;
using System.Collections.Generic;

namespace SimpleWorkflow.Patterns
{
    public class ContainerSegment : SimpleSegment
    {
        internal List<Segment> Segments { get; private set; }

        public ContainerSegment(List<Segment> segments, Type type) : base(type)
        {
            Segments = segments;
        }

        public ContainerSegment(Type type) : base(type)
        {
            Segments = new List<Segment>();
        }

        public void AddSegment(Segment segment)
        {
            Segments.Add(segment);
        }

        public void AddSegments(ContainerSegment segment)
        {
            Segments.AddRange(segment.Segments);
        }
    }
}
